////
////  DetailCustomCell.swift
////  HengYouCai
////
////  Created by lwj on 2017/11/10.
////  Copyright © 2017年 lwj. All rights reserved.
////

import UIKit

class DetailCustomCell: UITableViewCell {
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.selectionStyle = .none
        initUI()
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
    func initUI() {
        
        self.addSubview(redIcon)
        _ = redIcon.sd_layout()
            .leftSpaceToView(self,8)?
            .topSpaceToView(self,10)?
            .widthIs(15)?
            .heightIs(15)
        
        self.addSubview(titleLab)
        _ = titleLab.sd_layout()
            .leftSpaceToView(redIcon,0)?
            .centerYEqualToView(redIcon)?
            .autoWidthRatio(1)?
            .autoHeightRatio(1)
        titleLab.setSingleLineAutoResizeWithMaxWidth(JCWSCREENW-50)
        self.addSubview(desLab)
        _ = desLab.sd_layout()
            .leftSpaceToView(titleLab,8)?
            .rightSpaceToView(self,8)?
            .topSpaceToView(self,10)?
            .autoHeightRatio(0)
        
        desLab.setMaxNumberOfLinesToShow(0)
        
    }
    
    /// 小红点
    lazy var redIcon:UIImageView = {
        
        let temp = UIImageView()
        //        temp.layer.cornerRadius = 3
        //        temp.clipsToBounds = true
        //        temp.backgroundColor = UIColor.red
        return temp
    }()
    
    /// 标题
    lazy var titleLab :UILabel = {
        
        let temp = UILabel()
        temp.textColor = Normal_999Color
        temp.textAlignment = .left
        temp.font = Font_WL(13)
        temp.text = ""
        return temp
    }()
    /// 内容
    lazy var desLab :UILabel = {
        
        let temp = UILabel()
        temp.textColor = Normal_666Color
        temp.textAlignment = .left
        temp.font = Font_WL(13)
        temp.text = ""
        return temp
    }()
    
    /// 灰线
    lazy var lineView: UIView = {
        let temp = UIView()
        temp.backgroundColor = Normal_CCCColor
        return temp
    }()
    
}
